local nifu = fk.CreateSkill {

  name = "joy__nifu",

  tags = { Skill.Compulsory, },

}



nifu:addEffect(fk.TurnEnd, {
  name = "joy__nifu",
  anim_type = "drawcard",
  frequency = Skill.Compulsory,
  events = {fk.TurnEnd},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(nifu.name) and player:getHandcardNum() ~= 3
  end,
  on_use = function(self, event, target, player, data)
    local n = player:getHandcardNum() - 3
    if n < 0 then
      player:drawCards(-n, nifu.name)
    else
      player.room:askForDiscard(player, n, n, false, nifu.name, false)
    end
  end,
})

return nifu